﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MedicalDictationView
{
    public partial class VolumeForm : Form
    {
        public delegate void volumeHandler(object sender, volumeArgs args);
        public event volumeHandler eventVolume;

        public VolumeForm(Point pos, int max, int value)
        {
            this.Location = pos;
            //SetDisplayRectLocation(pos.X, pos.Y);
            InitializeComponent();
            volumeBar.Maximum = max;
            volumeBar.Value = value;
        }

        private void VolumeForm_Load(object sender, EventArgs e)
        {
            Width = 65;
            Height = 155;
        }

        private void VolumeForm_Deactivate(object sender, EventArgs e)
        {
            if (eventVolume != null)
                eventVolume(this, new volumeArgs(volumeBar.Value));
            Close();
        }
    }

    public class volumeArgs
    {
        int _value;

        public volumeArgs(int value)
        {
            _value = value;
        }

        public int Value
        {
            get { return _value; }
        }
    }
}
